home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
anidone
/
contour
/
contour.ctl
< prev
next >
Wrap
Text File
|
1995-05-02
|
1KB
|
56 lines
; CAD-3D CONTOUR object maker
; By Dan Reifsnyder
;
;The guts of this file are from Tom Hudson's FUNCTION.CTL
alert "CONTOUR generator|by Dan Reifsnyder"
status totv,usev,totf,usef,totob
availv=totv-usev:availf=totf-usef
@GETCOLOR
input " Enter grid color (1-15)",color:color=int(color)
if color<1 | color>15 then bell:goto GETCOLOR
@GETGRID
fopen "A:\TOPO.DAT"
FREAD grid
verts=grid*grid:faces=(grid-1)*(grid-1)*2
if verts>availv | faces>availf then bell:alert "Grid too big!":end
@GETSCALE
fread sc
@GETFACTOR
input " z-scaling factor% (10-100)",zscale
if zscale<10 | zscale>100 then bell:goto GETFACTOR
zscale=zscale/100
gstart=-(grid-1)/2*sc:gend=-gstart+sc/2
realstep=8000/(grid-1)
vertix=0
realx=-4000:for X=gstart to gend step sc
realy=-4000:for Y=gstart to gend step sc
fread Z
Z=Z*zscale
addvertex vertix,realx,realy,Z:vertix=vertix+1
realy=realy+realstep:next Y
realx=realx+realstep:next X
; BUILD FACES (VIEW FROM TOP ONLY)
faceix=0
for X=0 to grid-2
for Y=0 to grid-2
base=X+Y*grid
addface faceix,base,base+grid,base+grid+1,1,1,0,color
addface faceix+1,base,base+grid+1,base+1,0,1,1,color
faceix=faceix+2
next Y
next X
upload CONTOUR,vertix,faceix:clrgrp:select CONTOUR:home:bell:end